package base.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.Tag;

public class BsListTag extends BsContainerTag<Object> {

	private static final long serialVersionUID = 1L;
	
	private String dataUrl = "";
	private String href = "";
	
	@Override
	public int doStartTag() throws JspException {
		return Tag.EVAL_PAGE;
	}
	
	@Override
	public int doEndTag() throws JspException {
		
		StringBuffer tag = new StringBuffer();
		tag.append("<div class='col-md-" + colWidth + "'>\n");
		tag.append("<div class='panel panel-primary'>\n");
		tag.append("<div class='panel-heading'>" + caption + "<a href='" + href + "' style='float: right;color: #fff'>更多</a></div>\n");
		tag.append("<ul id='" + name + "' class='list-group'>\n");
		tag.append("</ul>");
		tag.append("</div>");
		tag.append("</div>");
		tag.append("<script type=\"text/javascript\">\n");
		tag.append("bindListData('" + name + "', '" + dataUrl + "')\n");
		tag.append("</script>\n");
		output(tag);
		return Tag.EVAL_PAGE;
	}

	public String getDataUrl() {
		return dataUrl;
	}

	public void setDataUrl(String dataUrl) {
		this.dataUrl = dataUrl;
	}

	public String getHref() {
		return href;
	}

	public void setHref(String href) {
		this.href = href;
	}

	
}
